﻿using System;
using System.Runtime.InteropServices;
using UnityEngine;

public class CinemaClipCurveWrapper : CinemaActionWrapper
{
    public CinemaMemberCurveWrapper[] MemberCurves;

    public CinemaClipCurveWrapper(Behaviour behaviour, float firetime, float duration) : base(behaviour, firetime, duration)
    {
        this.MemberCurves = new CinemaMemberCurveWrapper[0];
    }

    public bool TryGetValue(string type, string propertyName, out CinemaMemberCurveWrapper memberWrapper)
    {
        memberWrapper = null;
        foreach (CinemaMemberCurveWrapper wrapper in this.MemberCurves)
        {
            if ((wrapper.Type == type) && (wrapper.PropertyName == propertyName))
            {
                memberWrapper = wrapper;
                return true;
            }
        }
        return false;
    }

    internal bool IsEmpty
    {
        get
        {
            if ((this.MemberCurves != null) && (this.MemberCurves.Length > 0))
            {
                return false;
            }
            return true;
        }
    }

    internal int RowCount
    {
        get
        {
            int num = 0;
            foreach (CinemaMemberCurveWrapper wrapper in this.MemberCurves)
            {
                num++;
                if (wrapper.IsFoldedOut)
                {
                    CinemaAnimationCurveWrapper[] animationCurves = wrapper.AnimationCurves;
                    for (int i = 0; i < animationCurves.Length; i++)
                    {
                        CinemaAnimationCurveWrapper wrapper1 = animationCurves[i];
                        num++;
                    }
                }
            }
            return num;
        }
    }
}

